package cn.masterj.springcloud.service.fallback;

import cn.masterj.springcloud.service.IPaymentSentielService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author masterJ
 * @create 2020-04-18 17:32
 */
@Component
public class FeignFallbackFactory implements FallbackFactory<IPaymentSentielService> {

    @Override
    public IPaymentSentielService create(Throwable e) {
        e.printStackTrace();
        return new IPaymentSentielService() {
            @Override
            public String testA() {
                return "我是FeignFallbackFactory里的testAAA";
            }

            @Override
            public String testB(Long id) {
                return "我是FeignFallbackFactory里的testBBB;;;\t id:" + id;
            }
        };
    }
}
